package com.tuo51.evaluate.repositories.evaluatev2;

import com.tuo51.evaluate.domain.evaluatingV2.EvaluateV2RecordAnswer;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface EvaluateV2RecordAnswerRepository extends JpaRepository<EvaluateV2RecordAnswer, String> {

    List<EvaluateV2RecordAnswer> findAllByRecordId(String recordId);

    List<EvaluateV2RecordAnswer> findAllByRecordIdOrderByCreatedDesc(String recordId);

//  "questionId", "childrenId", "recordId"
    EvaluateV2RecordAnswer findTopByQuestionIdAndChildrenIdAndRecordId(String questionId, String childrenId, String recordId);
}
